"""Spark URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from square.views import Login, register, LoginView, SparkListView, SparkDetail, logout, add_new_spark
from user.views import MySparks
from Spark.second_admin import admin_site

urlpatterns = [
    path('admin/', admin_site.urls, name='admin'),   # 二级管理员
    path('login/', LoginView.as_view(), name='status'),  # 注册
    path('Login/', Login, name='login'),                # 注册
    path('register/', register, name='register'),
    path('superadmin/', admin.site.urls, name='superadmin'),    # 超级管理员
    path('index/', SparkListView.as_view(), name='index'),
    path('', SparkListView.as_view(), name='index'),
    path('sparkdetail/<int:spark_id>/', SparkDetail.as_view(), name='sparkdetail'),
    path('mysparks/',  MySparks.as_view(), name='mysparks'),
    path('logout/', logout, name='logout'),
    path('new_spark/', add_new_spark, name='add_spark'),
    # path('vote/', vote, name='vote')
]
